var t = getApp(), a = null;

Page({
    data: {
        StatusBar: t.globalData.StatusBar,
        CustomBar: t.globalData.CustomBar,
        CustomBarLeft: t.globalData.CustomBarLeft,
        bnAd_01: t.ad.bnAd_01
    },
    interstitialAdShow: function() {
        a && "function" == typeof a.show && this.canPageShowAd() && a.show().catch(function(t) {
            console.info(t);
        });
    },
    canPageShowAd: function() {
        try {
            var t = wx.getStorageSync("interstitialAdCache-selfdom");
            return "" == t || (Date.parse(new Date()) - t.time) / 1e3 > 3600;
        } catch (t) {}
        return !1;
    },
    onLoad: function(e) {
        wx.createInterstitialAd && this.canPageShowAd() && ((a = wx.createInterstitialAd({
            adUnitId: t.ad.cpAd_04
        })).onLoad(function() {}), a.onError(function(t) {}), a.onClose(function() {
            wx.setStorageSync("interstitialAdCache-selfdom", {
                time: Date.parse(new Date())
            });
        }));
    },
    onShow: function() {
        "function" == typeof this.getTabBar && this.getTabBar() && this.getTabBar().setData({
            selected: 4
        }), this.interstitialAdShow();
    },
    onShareAppMessage: function(t) {
        return {
            title: "随机数字、指尖运气、氛围灯、真心话大冒险、掐点、手机弹幕、屏幕心跳",
            path: "/pages/selfdom/selfdom"
        };
    },
    getLotteryy: function() {
        wx.navigateTo({
            url: "/pages/wave/wave"
        });
    },
    collection: function() {
        wx.showModal({
            title: "收藏",
            content: "添加到我的小程序或添加到桌面\r\n下次使用更方便\r\n\r\n具体方法：\r\n【1】点击右上角三个点\r\n【2】添加到我的小程序\r\n【3】再选择添加到桌面"
        });
    }
});